// pages/musicContent/musicContent.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    sort: "",
    data:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options)
    var sort = options.title
    var data = [];
    console.log(sort)
    switch (sort) {
      case "热门音乐": {
        data = wx.getStorageSync("hotMusic");
        break;
      }
      case "日乐": {
        data = wx.getStorageSync("japenMusic");
        break;
      }
      case "主播电台": {
        data = wx.getStorageSync("radioData");
        break;
      }
    };
    console.log(data);
    

    this.setData({
      sort,
      data
    })
  },
  handleId(event) {
    var id=event.currentTarget.dataset.id;
    console.log(id)
    wx.navigateTo({
      url: '/pages/musicDetail/musicDetail?id='+id,
    });
      
  }


})